package com.vanke.devops.domain.enums;

import com.vanke.core.exception.VankeBusinessException;

/**
 * @author 陈景阳
 * @since 2018/3/29
 */
public enum  EndpointsErrorCode implements ErrorCode{

    NOT_FOUND_ENDPOINT("0001","endpoint not found"),
    NOT_FOUND_ALI_YUM_ENDPOINT("0002","请输入有效的阿里云ID"),
    NOT_FOUND_IP("0003","请输入有效的IP段"),

    ;

    private String code;
    private String message;

    EndpointsErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return ErrorCode.getErrorCodePrefix(EndpointsErrorCode.class) + code;
    }
    @Override
    public String getMessage() {
        return message;
    }

    public VankeBusinessException getException(){
        return new VankeBusinessException(this.getCode(), this.getMessage());
    }
}
